package com.inetools.gwetons.client.impl;

import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.inetools.gwetons.client.FixPositionInClientWindow.AxisOrigin;

public class CalcFixPositionCoordinateImpl {
	/*
	 * Override this methods for IE6 permutation
	 */
	public void setPosition( Element element, AxisOrigin axisOrigin, Integer value) {
		Style elementStyle = element.getStyle();
		switch( axisOrigin) {
			case Left:
				elementStyle.setPropertyPx( "left", value);
				break;
			case Right:
				elementStyle.setPropertyPx( "right", value);
				break;
			case Top:
				elementStyle.setPropertyPx( "top", value);
				break;
			case Bottom:
				elementStyle.setPropertyPx( "bottom", value);
				break;
			default:
				return;
		} // switch
		element.getStyle().setProperty( "position", "fixed");
	}
}
